var io;
var voteStarted = false;
var socket = io.connect(document.location.href, {
	'reconnect': true,
	'reconnection delay': 500,
	'max reconnection attempts': 10,
	'transports': ['websocket'],
	'try multiple transport': false
});

socket.on('connect', function () {
	console.log("client connected");
});

socket.on('emitConnect', function () {
	console.log("client connected");
});

socket.on('disconnect', function () {
	console.log("disconnected");
	socket.disconnect();
});

// on load of page
$(function () {
	if ('WebSocket' in window) {
		document.getElementById("content").style.display = "block";
	} else {
		document.getElementById("noWebSocketSupp").style.display = "block";
	}

});